/**
 * Created by dqw on 2015/12/30.
 */

// 银行卡列表开始
var dtGridColumnsBank = [
    {
        id: 'delFlag',
        type: 'int',
        hideQuery: true,
        'export': false,
        hideQueryType: 'eq',
        hideQueryValue: 1,
        hide: true
    },
    {
        id: 'userId',
        type: 'int',
        hideQuery: true,
        'export': false,
        hideQueryType: 'eq',
        hideQueryValue: 2,
        hide: true
    },
    {
        id: 'id',
        title: '编号',
        type: 'number',
        headerClass: 'text-center width-50',
        columnClass: 'text-center width-50',
        fastSort: true,
        fastQuery: false,
    },

    {
        id: 'bankName',
        title: '银行名称',
        type: 'string',
        headerClass: 'text-center',
        columnClass: 'text-center',
        fastSort: false,
        fastQuery: true,
        fastQueryType: 'lk'
    },
    {
        id: 'branch',
        title: '支行名称',
        type: 'string',
        headerClass: 'text-center',
        columnClass: 'text-center',
        fastSort: false,
        fastQuery: false,
    },
    {
        id: 'bankNo',
        title: '银行卡号',
        type: 'string',
        headerClass: 'text-center',
        columnClass: 'text-center',
        fastSort: false,
        fastQuery: false,
    }
];


var dtGridOptionBank = {
    lang: 'zh-cn',
    ajaxLoad: true,
    loadURL: ncGlobal.adminRoot + 'userBank/json/list',
    columns: dtGridColumnsBank,
    gridContainer: 'dtGridContainerBank',
    pageSize: 50,
    pageSizeLimit: [10, 20, 50]
};

var grid1 = $.fn.DtGrid.init(dtGridOptionBank);
grid1.fastQueryParameters = new Object();
grid1.fastQueryParameters['eq_delFlag'] = 1;
grid1.fastQueryParameters['eq_userId'] = $("#userId").val();


function GetQueryString(name) {
    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
    var r = window.location.search.substr(1).match(reg);
    if (r != null) return unescape(r[2]);
    return null;
}

//操作处理开始
var DetailHandle = function () {
    function _bindEvent() {

    }

    //外部可调用
    return {
        bindEvent: _bindEvent
    }
}();
//操作处理结束

$(function () {
    //页面绑定事件
    DetailHandle.bindEvent();
    grid1.load();
});